#include <iostream>

using namespace std;

#define ROW     2
#define COLUMN  3

int main() {

    int array1[2][3] = {{1, 2, 3}, {4, 5}};
    int array2[2][3] = {{1, 2, 3}};
    int array3[2][3] = {1};
    int array4[2][3] = {};
    int array5[][3]  = {{1, 2, 3}, {4, 5}};
    int array6[2][3];
    int array7[ROW][COLUMN];
    int array8[ROW][COLUMN] = {{345, 678, 910}, {10004, 15}};

    int i;
    int j;

    array6[0][1] = 18;
    array7[1][2] = 512;

    cout << "array1:" << endl;
    for (i = 0; i < 2; i++) {
        for (j = 0; j < 3; j++) {
            cout << array1[i][j] << " ";
        }
        cout << endl;
    }

    cout << "array2:" << endl;
    for (i = 0; i < 2; i++) {
        for (j = 0; j < 3; j++) {
            cout << array2[i][j] << " ";
        }
        cout << endl;
    }

    cout << "array3:" << endl;
    for (i = 0; i < 2; i++) {
        for (j = 0; j < 3; j++) {
            cout << array3[i][j] << " ";
        }
        cout << endl;
    }

    cout << "array4:" << endl;
    for (i = 0; i < 2; i++) {
        for (j = 0; j < 3; j++) {
            cout << array4[i][j] << " ";
        }
        cout << endl;
    }

    cout << "array5:" << endl;
    for (i = 0; i < 2; i++) {
        for (j = 0; j < 3; j++) {
            cout << array5[i][j] << " ";
        }
        cout << endl;
    }

    cout << "array6:" << endl;
    for (i = 0; i < 2; i++) {
        for (j = 0; j < 3; j++) {
            cout << array6[i][j] << " ";
        }
        cout << endl;
    }

    cout << "array7:" << endl;
    for (i = 0; i < ROW; i++) {
        for (j = 0; j < COLUMN; j++) {
            cout << array7[i][j] << " ";
        }
        cout << endl;
    }

    cout << "array8:" << endl;
    for (i = 0; i < ROW; i++) {
        for (j = 0; j < COLUMN; j++) {
            cout << array8[i][j] << " ";
        }
        cout << endl;
    }

    /* 找出二维数组array8的最大值并打印出来, 在另一行输出这个最大值在二维数组中的二个下标值, 二个下标用空格隔开 */
    cout << "find max value of array8:" << endl;
    int num;
    int y = 0;
    int x = 0;
    for (i = 0; i < ROW; i++) {
        for (j = 0; j < COLUMN; j++) {
            if (i == 0 && j == 0){
                num = array8[i][j];
            }else{
                if (array8[i][j] > num) {
                    num = array8[i][j];
                    x = i;
                    y = j;
                }
            }
        }
    }
    cout << num << endl;
    cout << x << " ";
    cout << y;
    return 0;
}